# !/usr/bin/env python
# -*- coding: utf-8 -*-

from django.urls import path
from . import views
from mytest.views import pretty, login, bug, department, admin, chart, user
# from .views import PublisherListView

app_name = "mytest"
urlpatterns = [
        path("login/", login.login_view, name="login"),
        path("logout/", login.logout_view, name="logout"),
        path("workbench/", login.workbench, name="workbench"),

        # 部门管理
        path("data/", department.data_list, name="data_page"),
        path("data/add/", department.add_list, name="add_list"),
        path("data/<int:nid>/delete", department.delete_list, name="delete_list"),
        path("data/<int:nid>/edit", department.edit_list, name="edit_list"),

        # Bug管理
        path("bug/", bug.bug_page, name="bug_page"),
        path("bug/add/", bug.add_bug, name="add_bug"),
        path("bug/delete/<int:nid>", bug.delete_bug, name="delete_bug"),
        path("bug/edit/", bug.bug_edit, name="edit_bug"),

        # path("publishers/", PublisherListView.as_view()),
        # 靓号管理
        path("pretty/", pretty.pretty_list, name="pretty_list"),
        path("pretty/add/", pretty.pretty_add, name="pretty_add"),
        path("pretty/edit/", pretty.pretty_edit, name="pretty_edit"),
        path('pretty/delete/', pretty.pretty_delete, name="pretty_delete"),

        # 管理员路由
        path("admin/", admin.admin_list, name="admin_detail"),
        path("admin/add/", admin.admin_add, name="admin_add"),
        path("admin/edit/", admin.admin_edit, name="admin_edit"),
        path("admin/delete/", admin.admin_delete, name="admin_delete"),

        # 数据统计
        path("chart/", chart.chart_list, name="chart_list"),
        path("chart/bar/", chart.chart_bar, name="chart_bar"),
        path("chart/pie/", chart.chart_pie, name="chart_pie"),

        # 用户管理
        path("user/", user.user_list, name="user_list"),
        path("user/add/", user.user_add, name="user_add"),
]


